


'''

性能测试，选用部分边
'''

import random

from app.Package.steinertree.Steinertree.steinertree_bio import steinertree_bio


def  PerformanceTest(terminal_edges,rs,itera_num,GG,G,):

    # 选取一部分差异边
    u = random.sample(range(0, len(terminal_edges)), int(rs * len(terminal_edges)));
    uname = [terminal_edges[i] for i in u]

    # 进行斯坦纳树
    ustNodes,ustEdges = steinertree_bio(itera_num,uname,GG,G)


    return ustNodes,ustEdges